//
//  GGNetWorkURLMatcher.m
//  QuickAskCommunity
//
//  Created by yuemei on 2018/2/6.
//  Copyright © 2018年 GG. All rights reserved.
//

#import "GGNetWorkURLMatcher.h"

@implementation GGNetWorkURLMatcher


+ (NSString *)URLMatchingWithType:(GGURLPrefixType)type{
    NSString *urlStr = @"";
    switch (type) {
        case PrefixTypeWWW:
            urlStr = @"";
            break;
        case PrefixTypeChat:
            urlStr = @"";
            break;
        case PrefixTypeMM:
            urlStr = @"";
            break;
        case PrefixTypeSS:
            urlStr = @"";
            break;
        case PrefixTypeUser:
            urlStr = @"";
            break;
        case PrefixTypeSJAPP:
            urlStr = [NSString stringWithFormat:@"%@%@",@"",@""];
            break;
        default:
            break;
    }
    return urlStr;
}

+ (NSString *)URLMatchingWithType:(GGURLPrefixType)type suffix:(NSString *)suffix{
    return [NSString stringWithFormat:@"%@%@",[self URLMatchingWithType:type],suffix];
}
+ (GGURLPrefixType)URLTypeMatchingWithURL:(NSString *)urlStr{
    GGURLPrefixType type = PrefixTypeNone;
    NSArray *typeArray = @[@(PrefixTypeSJAPP),@(PrefixTypeWWW),@(PrefixTypeMM),@(PrefixTypeChat),@(PrefixTypeUser),@(PrefixTypeSS)];
    for (NSNumber *cycleTypeNum in typeArray) {
        GGURLPrefixType cycleType = [cycleTypeNum integerValue];
        if ([urlStr hasPrefix:[self URLMatchingWithType:cycleType]]) {
            type    = cycleType;
            break;
        }
    }
    return type;
}




@end
